package com.xplusplus.security.repository;

import com.xplusplus.security.domain.Permission;
import com.xplusplus.security.domain.Role;
import com.xplusplus.security.domain.RolePermission;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @Author: zhouweixin
 * @Description:
 * @Date: Created in 18:41 2019/1/7
 * @Modified By:
 */
public interface RolePermissionRepository extends JpaRepository<RolePermission, Integer> {
    List<RolePermission> findByPermission(Permission permission);
    List<RolePermission> findByRole(Role role);
    void deleteByPermission(Permission permission);
    void deleteByRole(Role role);
}
